package Utilidades;

import java.io.FileInputStream;
import java.util.Properties;

/**
 *
 * @author Juampi
 */
public class Settings {

    private String dbURL = "";
    private String dbUser = "";
    private String dbPass = "";
    private String userData = "";
    private String xmlPath = "";
    private static Settings instance = null;

    private Settings() {
        readINI();
    }

    public static Settings getInstance() {
        if (instance == null) {
            instance = new Settings();
        }
        return instance;
    }

    private void readINI() {
        try {
            Properties properties = new Properties();
            properties.load(new FileInputStream("agenda.ini"));
            dbURL = properties.getProperty("dbURL");
            dbUser = properties.getProperty("dbUser");
            dbPass = properties.getProperty("dbPass");
            userData = properties.getProperty("userData");
            xmlPath = properties.getProperty("xmlPath");
        } catch (Exception ex) {
        }
    }

    public String getDbURL() {
        return dbURL;
    }

    public String getDbUser() {
        return dbUser;
    }

    public String getDbPass() {
        return dbPass;
    }

    public String getUserData() {
        return userData;
    }

    public String getXmlPath() {
        return xmlPath;
    }
}
